<template>
    <div class="mui-numbox" data-numbox-min='1' :data-numbox-max='carmax'>
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input   class="mui-input-numbox" type="number" ref="looknum" @change='updatenum' :value="spannum" />
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
				</div>
</template>

<script>
import mui from '../../lib/mui/js/mui.min.js'
    export default{
        mounted () {
            this.numbox()
        },
        data () {
            return {
                id:this.$route.params.id  
            }
        },
       
        methods: {
            numbox(){
                mui('.mui-numbox').numbox()
            }, 
            updatenum(){
                var k = {
                    id:this.updateid,
                    count:this.$refs.looknum.value
                }
                console.log(k.id)
              this.$store.commit('updatecar',k)

                console.log(this.$refs.looknum.value)
            } 
        },
        props:['carmax','spannum','updateid']
    }
</script>

<style lang="less" scoped>

</style>

